'==================================================================================================
'	Author		David Segura
'	URL			http://winpeguy.com/
'	Source		http://winpe.codeplex.com/
'	Version		20130910
'==================================================================================================
'	Purpose:
'	This file contains functions to change the Display Resolution
'==================================================================================================
'	File Locations in Windows:
'	%DeployRoot%\Boot\+WinPE\Menu\Scripts\DisplayResolution.vbs
'==================================================================================================
'	File Location in WinPE:
'	X:\Menu\Scripts\DisplayResolution.vbs
'==================================================================================================
'	Configuration:
'	None.  Editing this file is not recommended
'==================================================================================================
'	Change Log:
'	20130910	Codeplex Beta
'==================================================================================================
'	More Information:
'	PowerShell Commands to Change Screen Resolution
'	Ref	http://blogs.technet.com/b/heyscriptingguy/archive/2010/07/07/hey-scripting-guy-how-can-i-change-my-desktop-monitor-resolution-via-windows-powershell.aspx
'	Ref	http://kindleit.blogspot.com/2012/09/changing-screen-resolution-with.html
'==================================================================================================
Sub subDisplayMessage
	MsgBox "Not all resolutions are supported in WinPE" & vbCrLf & "" & vbCrLf & _
	"If a resolution is not supported, then no changes will be made",64,MsgBoxTitleShort & "Change Display Resolution"
End Sub

Sub subDisplayPre
	subDisplayMessage
End Sub

Sub subDisplayPost
	sCmd = "wscript " & strScriptsDir & "\Sleep.vbs"
	objShell.Run sCmd,1,True
	
	Window_OnLoad
	Location.Reload(True)
End Sub

Sub subDisplay1024x768
	If objFSO.FileExists(envSystem32 & "\WindowsPowershell\v1.0\powershell.exe") Then
		subDisplayPre
		sCmd = "powershell " & strScriptsDir & "\DisplayResolution\1024x768.ps1"
		objShell.Run sCmd,1,True
		subDisplayPost
	Else
		MsgBox "ADK Optional Component WinPE-PowerShell3 must be installed before using this feature",16,MsgBoxTitleShort & "Change Display Resolution"
	End If
End Sub
Sub subDisplay1280x768
	If objFSO.FileExists(envSystem32 & "\WindowsPowershell\v1.0\powershell.exe") Then
		subDisplayPre
		sCmd = "powershell " & strScriptsDir & "\DisplayResolution\1280x768.ps1"
		objShell.Run sCmd,1,True
		subDisplayPost
	Else
		MsgBox "ADK Optional Component WinPE-PowerShell3 must be installed before using this feature",16,MsgBoxTitleShort & "Change Display Resolution"
	End If
End Sub
Sub subDisplay1280x1024
	If objFSO.FileExists(envSystem32 & "\WindowsPowershell\v1.0\powershell.exe") Then
		subDisplayPre
		sCmd = "powershell " & strScriptsDir & "\DisplayResolution\1280x1024.ps1"
		objShell.Run sCmd,1,True
		subDisplayPost
	Else
		MsgBox "ADK Optional Component WinPE-PowerShell3 must be installed before using this feature",16,MsgBoxTitleShort & "Change Display Resolution"
	End If
End Sub
Sub subDisplay1366x768
	If objFSO.FileExists(envSystem32 & "\WindowsPowershell\v1.0\powershell.exe") Then
		subDisplayPre
		sCmd = "powershell " & strScriptsDir & "\DisplayResolution\1366x768.ps1"
		objShell.Run sCmd,1,True
		subDisplayPost
	Else
		MsgBox "ADK Optional Component WinPE-PowerShell3 must be installed before using this feature",16,MsgBoxTitleShort & "Change Display Resolution"
	End If
End Sub
Sub subDisplay1600x900
	If objFSO.FileExists(envSystem32 & "\WindowsPowershell\v1.0\powershell.exe") Then
		subDisplayPre
		sCmd = "powershell " & strScriptsDir & "\DisplayResolution\1600x900.ps1"
		objShell.Run sCmd,1,True
		subDisplayPost
	Else
		MsgBox "ADK Optional Component WinPE-PowerShell3 must be installed before using this feature",16,MsgBoxTitleShort & "Change Display Resolution"
	End If
End Sub
Sub subDisplay1920x1080
	If objFSO.FileExists(envSystem32 & "\WindowsPowershell\v1.0\powershell.exe") Then
		subDisplayPre
		sCmd = "powershell " & strScriptsDir & "\DisplayResolution\1920x1080.ps1"
		objShell.Run sCmd,1,True
		subDisplayPost
	Else
		MsgBox "ADK Optional Component WinPE-PowerShell3 must be installed before using this feature",16,MsgBoxTitleShort & "Change Display Resolution"
	End If
End Sub